local t = Def.ActorFrame{};
local failed = STATSMAN:GetCurStageStats():AllFailed();
local exget = GAMESTATE:HasEarnedExtraStage();
local ex2 = GAMESTATE:IsExtraStage2();

t[#t+1] = Def.ActorFrame {
	InitCommand=function(self) self:xy(SCREEN_CENTER_X,SCREEN_TOP+25):zoom(0.6):zoomy(0):diffusealpha(1) end;
	OnCommand=function(self) self:sleep(0.2):linear(0.15):zoomy(0.6) end;
	OffCommand=function(self) self:sleep(0.2):linear(0.15):zoomx(1):zoomy(0) end;
	LoadActor("_headerframe")..{
		InitCommand=function(self)
			if ex2 and exget then
				self:sleep(3.4):queuecommand("Vibe1")
			elseif ex2 and failed and not exget then
				self:visible(false)
			end
		end;
	};
	LoadActor("_results")..{
		InitCommand=function(self) self:diffusealpha(0) end;
		OnCommand=function(self)
			local name = SCREENMAN:GetTopScreen():GetNextScreenName();
			if name == "ScreenEvaluationSummary" or name == "ScreenGameOver" or name == "ScreenEnding" then
				self:sleep(0.5):queuecommand("FlickerOn")
			elseif name == "ScreenEvaluationSummary" and ex2 then
				self:sleep(0.5)
			elseif ex2 and not exget then
				self:sleep(0.5)
			elseif event == false and failed == true then
				self:sleep(0.5)
			elseif ex2 and exget then
				self:sleep(0.5):playcommand("FlickerOn"):sleep(2.75):queuecommand("Vibe1")
			else
				self:sleep(0.5):queuecommand("FlickerOn")
			end
		end;
		OffCommand=function(self) 
			if ex2 and not exget then
				self:sleep(0.5)
			elseif event == false and failed == true then
				self:sleep(0.5)
			else
				self:queuecommand("FlickerOff")
			end
		end;
		FlickerOnCommand=function(self) self:diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1) end;
		FlickerOffCommand=function(self) self:diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0) end;
	};
	LoadActor("_allclear")..{
		Condition=ex2 and not exget and not failed;
		InitCommand=function(self) self:diffusealpha(0):zoom(0.5) end;
		OnCommand=function(self) self:sleep(0.7):queuecommand("Blink") end;
		OffCommand=function(self) self:queuecommand("FlickerOff") end;
		BlinkCommand=function(self) self:diffusealpha(1):sleep(0.3):diffusealpha(0):sleep(0.3):queuecommand("Blink") end;
		FlickerOffCommand=function(self) self:diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0):sleep(0.03):diffusealpha(1):sleep(0.03):diffusealpha(0) end;
	};
};

return t;